﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace easteradventure
{
    class Bunny : Microsoft.Xna.Framework.DrawableGameComponent
    {
        private Vector2 position;
        private Vector2 origin;
        private Texture2D texture;
        Game1 game;
        public Bunny(Game1 game)
            : base(game)
        {
            this.game = game;  
        }

        public void changePosition(int x, int y)
        {
            position.X += x;
            position.Y += y;            
        }
        public void setPosition(int x, int y)
        {
            position.X = x;
            position.Y = y;

        }
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization code here       
           

            base.Initialize();
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
           texture = game.Content.Load<Texture2D>("BunnyOblique46");         
        }

        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            game.spriteBatch.Draw(texture, position, null, Color.White, 0.0f, origin, 1.0f, SpriteEffects.None, 0.8f);           
            base.Draw(gameTime);
        }
    }
}
